<?php

namespace catchAdmin\pc\tables;

use catchAdmin\pc\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class NewsClass extends CatchTable
{

    public function Table()
    {
        return $this->getTable('newsClass')
            ->header([
                HeaderItem::label('分类名称')->prop('class_name'),
                HeaderItem::label('权限')->prop('status_name'),
                HeaderItem::label('操作')
                    ->actions([
                        Actions::update(),
                        Actions::delete(),
                    ])
                    ->width(260),
            ])
            ->withSearch([
                Search::label('分类名称')->text('class_name', '分类名称')->clearable(true),

            ])
            ->selectionChange()
            ->withApiRoute('newsClass')
            ->withActions([
                Actions::create(),
            ])
            ->render();
    }


    public function form()
    {
        return Factory::create('newsClass');
    }

}
